/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.shop.entity;

import com.fasterxml.jackson.annotation.JsonBackReference;
import org.hibernate.validator.constraints.Length;
import java.util.List;
import com.google.common.collect.Lists;

import com.thinkgem.jeesite.common.persistence.DataEntity;

/**
 * 商品属性管理Entity
 * @author xxs
 * @version 2016-03-03
 */
public class Attribute extends DataEntity<Attribute> {
	
	private static final long serialVersionUID = 1L;
	private GoodsCategory goodsCategory;		// 绑定分类
	private String name;		// 名称
	private Integer propertyIndex;		// 属性位置
	private Integer sort;		// 排序
	private List<AttributeItem> attributeItemList = Lists.newArrayList();		// 子表列表
	
	public Attribute() {
		super();
	}

	public Attribute(String id){
		super(id);
	}

	@JsonBackReference
	public GoodsCategory getGoodsCategory() {
		return goodsCategory;
	}

	public void setGoodsCategory(GoodsCategory goodsCategory) {
		this.goodsCategory = goodsCategory;
	}
	
	@Length(min=0, max=100, message="名称长度必须介于 0 和 100 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public Integer getPropertyIndex() {
		return propertyIndex;
	}

	public void setPropertyIndex(Integer propertyIndex) {
		this.propertyIndex = propertyIndex;
	}
	
	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}
	
	public List<AttributeItem> getAttributeItemList() {
		return attributeItemList;
	}

	public void setAttributeItemList(List<AttributeItem> attributeItemList) {
		this.attributeItemList = attributeItemList;
	}
}